@import "commonvars";

.scastie {
  .cm-cursor {
    border-left-width: 2px;
  }

  .cm-editor , .cm-scroller, .inline {
    font-family: $code-font-family;
    font-weight: normal;
    height: 100%;
  }

  .cm-tooltip-section > *, .cm-diagnosticText > * {
    font-family: $font-family;
    font-weight: normal;
  }

  .cm-simplescroll-vertical {
    width: 12px;
    margin-right: 2px;
  }

  .cm-simplescroll-horizontal {
    height: 12px;
    margin-bottom: 2px;
  }

  .cm-simplescroll-vertical,
  .cm-simplescroll-horizontal { 
    background-color: transparent;
    div {
      border: none;
    }
  }

  .cm-scroll {
    overflow: auto;
  }

  $margin: 0px;
  .cm-line {
    line-height: normal;
    padding: $margin;
  }
  .cm-linenumber{
    margin-left: -$margin;
  }
  .inline {
    overflow: hidden;
    margin-left: 5px;
    vertical-align: top;
    padding: 0px 1px 1px 5px;
    white-space: pre-wrap;
    display: inline-block;
    opacity: 75%;
  }

  .cm-widget .fold.code-fold {
    cursor: pointer;
  }

  .cm-hints {
    z-index: 10;

    max-height: 50%;
    max-width: 100%;
    border: none;
    margin-left: -$sidebar-width;
    margin-top: -($header-height + $editor-topbar-height);

    .autocomplete {
      line-height: initial;
      display: inline-table;
      max-width: none;
      width: 100%;
      resize: none;
      .name {
        display: table-cell;
        max-width: none;
        width: 20%;
      }
      .signature {
        display: table-cell;
        max-width: 0;
        width: 60%;
        text-align: left;
        padding-left: 5px;
        text-overflow: ellipsis;
        overflow: hidden;
      }
      .result-type {
        display: table-cell;
        max-width: 0;
        width: 20%;
        text-align: right;
        padding-left: 5px;
        text-overflow: ellipsis;
        overflow: hidden;
      }
    }
  }

  .cm-hints.presentation-mode {
    margin-left: 0;
    margin-top: -$editor-topbar-height;
  }

  .cm-gutters {
    white-space: nowrap;
  }
  .cm-linenumber {
    padding: 0 3px 0 5px;
    text-align: right;
    white-space: nowrap;
  }

  .cm-hover-tooltip {
    border: 1px solid black;
    border-radius: 2px 2px 2px 2px;
    font-family: $code-font-family;
    font-size: 10pt;
    overflow: hidden;
    padding: 2px 5px;
    position: fixed;
    z-index: 100;
    max-width: 600px;
    opacity: 0;
    transition: opacity .4s;
    -moz-transition: opacity .4s;
    -webkit-transition: opacity .4s;
    -o-transition: opacity .4s;
    -ms-transition: opacity .4s;
    background-color: #0f262f;
    color: #dfdfdf;
  }

  .loading-message {
    margin-top: 0px;
    margin-left: 25px;
    transition: opacity .6s;
    -moz-transition: opacity .6s;
    -webkit-transition: opacity .6s;
    -o-transition: opacity .6s;
    -ms-transition: opacity .6s;
  }

  .cm-vim-panel {
    background-color: #c4c6c7;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #2d3748;
    font-family: $code-font-family;
    padding: 8px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .cm-vim-panel input {
    color: inherit;
    font-family: inherit;
  }

  .dark .cm-vim-panel {
    background-color: #1a202c !important;
    border-color: #2d3748 !important;
    color: #f7fafc !important;
  }

  .cm-editor:has(.cm-vim-panel) .cm-cursor,
  .cm-editor:has(.cm-vim-panel) .cm-cursor-primary,
  .cm-editor:has(.cm-vim-panel) .cm-vimCursorLayer {
    display: none !important;
  }
}
